package com.example.study_thread.a_file;

import java.io.File;

public class Demo1File {
    public static void main(String[] args) {
        file1();

        file2();
    }

    private static void file2() {
        String path1 = "E:\\Idea\\io";
        System.out.println(path1);

//        要求代码写完，一次编写，到处运行
        String path2 = "E:" + File.separator + "Idea" + File.separator + "io";
        System.out.println(path2);
    }

    private static void file1() {
//        与系统相关的路径分隔符，，表示为一个字符串，如;
        String pathSeparator = File.pathSeparator;
        System.out.println("pathSeparator" + pathSeparator);

//        与系统有关的默认名称分隔符，表示为一个字符串\
        String separator = File.separator;
        System.out.println("separator" + separator);
    }
}
